package org.luxor.commons.workflow.entity;

import java.io.Serializable;
import java.util.Date;

/**
 * 自定义执行实例类
 *
 * @author Mr.yan  @date 2022/8/19
 */
public class CustomExecutionEntity implements Serializable {

    /**
     * 执行实例ID
     */
    private String id;

    /**
     * 乐观锁,Version(版本)
     */
    private Integer revision;

    /**
     * 流程实例ID
     */
    private String processInstanceId;

    /**
     * 业务主键ID
     */
    private String businessKey;

    /**
     * 父节点实例ID
     */
    private String parentId;

    /**
     * 流程定义ID
     */
    private String processDefinitionId;

    /**
     * 父执行实例(act_ru_execution.id)
     */
    private String superExecutionId;

    /**
     * 根流程ID(标志此执行流程是由该字段所指执行流程产生)
     */
    private String rootProcessInstanceId;

    /**
     * 节点实例ID(act_hi_actinst.id)
     */
    private String activityId;

    /**
     * 是否活动(true/false)
     */
    private boolean isActive;

    /**
     * 否为并行(true/false)
     */
    private boolean isConcurrent;

    /**
     * 是否范围执行(0非,1是)
     */
    private boolean isScope;

    /**
     * 是否事件范围(一般为0)
     */
    private boolean isEventScope;

    /**
     * 是否多实例根执行实例
     */
    private boolean isMultiInstanceRoot;

    /**
     * 挂起状态	(1激活,2挂起)
     */
    private Integer suspensionState;

    /**
     * 流程视图缓存
     */
    private Integer cachedEndState;

    /**
     * 租户ID
     */
    private String tenantId;

    /**
     * 执行流程实例名称
     */
    private String name;

    /**
     * 执行流程实例时间
     */
    private Date startTime;

    /**
     * 执行流程实例开始用户ID
     */
    private String startUserId;

    /**
     * 锁定时间
     */
    private Date lockTime;

    /**
     * 是否启动统计
     */
    private boolean isCountEnabled;

    /**
     * 时间定义数量
     */
    private Integer eventSubscriptionCount;

    /**
     * 任务数量
     */
    private Integer taskCount;

    /**
     * 作业数量
     */
    private Integer jobCount;

    /**
     * 定时作业数量
     */
    private Integer timerJobCount;

    /**
     * 中断作业数量
     */
    private Integer suspendedJobCount;

    /**
     * 无法执行作业数量
     */
    private Integer deadLetterJobCount;

    /**
     * 参数数量
     */
    private Integer variableCount;

    /**
     * 用户关联数量
     */
    private Integer identityLinkCount;

    public CustomExecutionEntity() {
        this.setRevision(1);
        this.setSuspensionState(1);
        this.setTaskCount(0);
        this.setEventSubscriptionCount(0);
        this.setJobCount(0);
        this.setTimerJobCount(0);
        this.setSuspendedJobCount(0);
        this.setDeadLetterJobCount(0);
        this.setVariableCount(0);
        this.setIdentityLinkCount(0);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getRevision() {
        return revision;
    }

    public void setRevision(Integer revision) {
        this.revision = revision;
    }

    public String getProcessInstanceId() {
        return processInstanceId;
    }

    public void setProcessInstanceId(String processInstanceId) {
        this.processInstanceId = processInstanceId;
    }

    public String getBusinessKey() {
        return businessKey;
    }

    public void setBusinessKey(String businessKey) {
        this.businessKey = businessKey;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getProcessDefinitionId() {
        return processDefinitionId;
    }

    public void setProcessDefinitionId(String processDefinitionId) {
        this.processDefinitionId = processDefinitionId;
    }

    public String getSuperExecutionId() {
        return superExecutionId;
    }

    public void setSuperExecutionId(String superExecutionId) {
        this.superExecutionId = superExecutionId;
    }

    public String getRootProcessInstanceId() {
        return rootProcessInstanceId;
    }

    public void setRootProcessInstanceId(String rootProcessInstanceId) {
        this.rootProcessInstanceId = rootProcessInstanceId;
    }

    public String getActivityId() {
        return activityId;
    }

    public void setActivityId(String activityId) {
        this.activityId = activityId;
    }

    public boolean isActive() {
        return isActive;
    }

    public void setActive(boolean active) {
        isActive = active;
    }

    public boolean isConcurrent() {
        return isConcurrent;
    }

    public void setConcurrent(boolean concurrent) {
        isConcurrent = concurrent;
    }

    public boolean isScope() {
        return isScope;
    }

    public void setScope(boolean scope) {
        isScope = scope;
    }

    public boolean isEventScope() {
        return isEventScope;
    }

    public void setEventScope(boolean eventScope) {
        isEventScope = eventScope;
    }

    public boolean isMultiInstanceRoot() {
        return isMultiInstanceRoot;
    }

    public void setMultiInstanceRoot(boolean multiInstanceRoot) {
        isMultiInstanceRoot = multiInstanceRoot;
    }

    public Integer getSuspensionState() {
        return suspensionState;
    }

    public void setSuspensionState(Integer suspensionState) {
        this.suspensionState = suspensionState;
    }

    public Integer getCachedEndState() {
        return cachedEndState;
    }

    public void setCachedEndState(Integer cachedEndState) {
        this.cachedEndState = cachedEndState;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public String getStartUserId() {
        return startUserId;
    }

    public void setStartUserId(String startUserId) {
        this.startUserId = startUserId;
    }

    public Date getLockTime() {
        return lockTime;
    }

    public void setLockTime(Date lockTime) {
        this.lockTime = lockTime;
    }

    public boolean isCountEnabled() {
        return isCountEnabled;
    }

    public void setCountEnabled(boolean countEnabled) {
        isCountEnabled = countEnabled;
    }

    public Integer getEventSubscriptionCount() {
        return eventSubscriptionCount;
    }

    public void setEventSubscriptionCount(Integer eventSubscriptionCount) {
        this.eventSubscriptionCount = eventSubscriptionCount;
    }

    public Integer getTaskCount() {
        return taskCount;
    }

    public void setTaskCount(Integer taskCount) {
        this.taskCount = taskCount;
    }

    public Integer getJobCount() {
        return jobCount;
    }

    public void setJobCount(Integer jobCount) {
        this.jobCount = jobCount;
    }

    public Integer getTimerJobCount() {
        return timerJobCount;
    }

    public void setTimerJobCount(Integer timerJobCount) {
        this.timerJobCount = timerJobCount;
    }

    public Integer getSuspendedJobCount() {
        return suspendedJobCount;
    }

    public void setSuspendedJobCount(Integer suspendedJobCount) {
        this.suspendedJobCount = suspendedJobCount;
    }

    public Integer getDeadLetterJobCount() {
        return deadLetterJobCount;
    }

    public void setDeadLetterJobCount(Integer deadLetterJobCount) {
        this.deadLetterJobCount = deadLetterJobCount;
    }

    public Integer getVariableCount() {
        return variableCount;
    }

    public void setVariableCount(Integer variableCount) {
        this.variableCount = variableCount;
    }

    public Integer getIdentityLinkCount() {
        return identityLinkCount;
    }

    public void setIdentityLinkCount(Integer identityLinkCount) {
        this.identityLinkCount = identityLinkCount;
    }

    @Override
    public String toString() {
        return "CustomExecutionEntity{" +
                "id='" + id + '\'' +
                ", revision=" + revision +
                ", processInstanceId='" + processInstanceId + '\'' +
                ", businessKey='" + businessKey + '\'' +
                ", parentId='" + parentId + '\'' +
                ", processDefinitionId='" + processDefinitionId + '\'' +
                ", superExecutionId='" + superExecutionId + '\'' +
                ", rootProcessInstanceId='" + rootProcessInstanceId + '\'' +
                ", activityId='" + activityId + '\'' +
                ", isActive=" + isActive +
                ", isConcurrent=" + isConcurrent +
                ", isScope=" + isScope +
                ", isEventScope=" + isEventScope +
                ", isMultiInstanceRoot=" + isMultiInstanceRoot +
                ", suspensionState=" + suspensionState +
                ", cachedEndState=" + cachedEndState +
                ", tenantId='" + tenantId + '\'' +
                ", name='" + name + '\'' +
                ", startTime=" + startTime +
                ", startUserId='" + startUserId + '\'' +
                ", lockTime=" + lockTime +
                ", isCountEnabled=" + isCountEnabled +
                ", eventSubscriptionCount=" + eventSubscriptionCount +
                ", taskCount=" + taskCount +
                ", jobCount=" + jobCount +
                ", timerJobCount=" + timerJobCount +
                ", suspendedJobCount=" + suspendedJobCount +
                ", deadLetterJobCount=" + deadLetterJobCount +
                ", variableCount=" + variableCount +
                ", identityLinkCount=" + identityLinkCount +
                '}';
    }
}
